<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
<form method="post">
    <label>Text:</label>
    <textarea name="text"></textarea>
    <label>Banlist:</label>
    <textarea name="banlist"></textarea>
    <input type="submit" value="Censure" />
</form>
<?php
if (isset($_POST['text']) && isset($_POST['banlist'])) {
    $text = $_POST['text'];
    $banlist = explode(", ", $_POST['banlist']);

    foreach ($banlist as $wordToCensure) {
        $text = str_ireplace($wordToCensure, str_repeat("*", strlen($wordToCensure)), $text);
    }

    echo $text;
}
?>
</body>
</html>